package com.cskaoyan.user.utils;

import org.springframework.util.DigestUtils;

public class MD5Utils {

    public static String encryptPassword(String password,String username){

        //对用户密码加密时，用户输入的原始密码追加上用户账号的三位字符，生成数据库中存放的用户密码
        password = password+username.charAt(2);

        String encryptPassword = DigestUtils.md5DigestAsHex(password.getBytes());

        return encryptPassword;
    }
}
